<template>
  <div class="home-page">
    <van-nav-bar
      title="首页"
      left-text="返回"
      right-text="按钮"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <van-cell-group>
      <van-cell title="路由跳转" is-link to="index" />
    </van-cell-group>
  </div>
</template>

<script lang="ts" setup>
import { showToast } from 'vant'
import DialogDemo from '@/components/DialogDemo.vue'
import { showCustomModal } from '@/utils'
const onClickLeft = () => history.back()
const onClickRight = () => showToast('按钮')
onMounted(() => {
  showCustomModal(DialogDemo, null)
  // can fetch data by this example
  // KnowledgeService.getAccessToken().then((res) => {
  //   console.log('请求结果', res)
  // })
})
onActivated(() => {
  console.log('路由激活')
})
</script>

<style lang="scss"></style>
